/*
 * File: Auto.h
 *
 * Code generated for Simulink model 'Auto'.
 *
 * Model version                  : 1.259
 * Simulink Coder version         : 8.0 (R2011a) 09-Mar-2011
 * TLC version                    : 8.0 (Feb  3 2011)
 * C/C++ source code generated on : Tue Sep 20 20:17:44 2011
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Texas Instruments->C2000
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#ifndef RTW_HEADER_Auto_h_
#define RTW_HEADER_Auto_h_
#ifndef Auto_COMMON_INCLUDES_
# define Auto_COMMON_INCLUDES_
#include <stddef.h>
#include <string.h>
#include "rtwtypes.h"
#endif                                 /* Auto_COMMON_INCLUDES_ */

#include "Auto_types.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
# define rtmGetErrorStatus(rtm)        ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
# define rtmSetErrorStatus(rtm, val)   ((rtm)->errorStatus = (val))
#endif

/* Block signals (auto storage) */
typedef struct {
  real_T EnThr;                        /* '<S1>/Chart' */
  real_T Bias;                         /* '<S6>/Bias' */
  real_T Bias_f;                       /* '<S7>/Bias' */
  boolean_T Auto_d;                    /* '<S1>/Chart' */
} BlockIO_Auto;

/* Block states (auto storage) for system '<Root>' */
typedef struct {
  real_T Filter_DSTATE;                /* '<S18>/Filter' */
  real_T Integrator_DSTATE;            /* '<S19>/Integrator' */
  real_T Filter_DSTATE_i;              /* '<S19>/Filter' */
  real_T Integrator_DSTATE_a;          /* '<S13>/Integrator' */
  real_T Filter_DSTATE_c;              /* '<S13>/Filter' */
  real_T Integrator_DSTATE_j;          /* '<S12>/Integrator' */
  real_T Filter_DSTATE_m;              /* '<S12>/Filter' */
  real_T Filter_DSTATE_a;              /* '<S14>/Filter' */
  real_T Integrator_DSTATE_m;          /* '<S14>/Integrator' */
  uint8_T is_active_c1_Auto;           /* '<S1>/Chart' */
  uint8_T is_c1_Auto;                  /* '<S1>/Chart' */
  boolean_T AutoController_MODE;       /* '<S1>/AutoController' */
} D_Work_Auto;

/* External inputs (root inport signals with auto storage) */
typedef struct {
  real_T Roll;                         /* '<Root>/Roll' */
  real_T Pitch;                        /* '<Root>/Pitch' */
  real_T Yaw;                          /* '<Root>/Yaw' */
  real_T Thr;                          /* '<Root>/Thr' */
  real_T RPY[3];                       /* '<Root>/RPY' */
  real_T omega[3];                     /* '<Root>/omega' */
} ExternalInputs_Auto;

/* External outputs (root outports fed by signals with auto storage) */
typedef struct {
  real_T Left11001350;                 /* '<Root>/Left[1100:::1350]' */
  real_T Right11001350;                /* '<Root>/Right[1100:::1350]' */
  real_T Tail11001600;                 /* '<Root>/Tail[1100:::1600]' */
  real_T TailVec4545;                  /* '<Root>/TailVec[-45:::45]' */
} ExternalOutputs_Auto;

/* Parameters (auto storage) */
struct Parameters_Auto_ {
  real_T LeftOutPWM_Y0;                /* Expression: 1000
                                        * Referenced by: '<S2>/LeftOutPWM'
                                        */
  real_T RightOutPWM_Y0;               /* Expression: 1000
                                        * Referenced by: '<S2>/RightOutPWM'
                                        */
  real_T TailOutPWM_Y0;                /* Expression: 1000
                                        * Referenced by: '<S2>/TailOutPWM'
                                        */
  real_T TailAngle_Y0;                 /* Expression: 0
                                        * Referenced by: '<S2>/TailAngle'
                                        */
  real_T Gain_Gain;                    /* Expression: 1/1000
                                        * Referenced by: '<S2>/Gain'
                                        */
  real_T Bias_Bias;                    /* Expression: -1
                                        * Referenced by: '<S2>/Bias'
                                        */
  real_T JoyScale_Gain;                /* Expression: 1
                                        * Referenced by: '<S16>/JoyScale'
                                        */
  real_T ProportionalGain_Gain;        /* Expression: P
                                        * Referenced by: '<S18>/Proportional Gain'
                                        */
  real_T DerivativeGain_Gain;          /* Expression: D
                                        * Referenced by: '<S18>/Derivative Gain'
                                        */
  real_T Filter_gainval;               /* Computed Parameter: Filter_gainval
                                        * Referenced by: '<S18>/Filter'
                                        */
  real_T Filter_IC;                    /* Expression: InitialConditionForFilter
                                        * Referenced by: '<S18>/Filter'
                                        */
  real_T FilterCoefficient_Gain;       /* Expression: N
                                        * Referenced by: '<S18>/Filter Coefficient'
                                        */
  real_T Saturation_UpperSat;          /* Expression: UpperSaturationLimit
                                        * Referenced by: '<S18>/Saturation'
                                        */
  real_T Saturation_LowerSat;          /* Expression: LowerSaturationLimit
                                        * Referenced by: '<S18>/Saturation'
                                        */
  real_T ProportionalGain_Gain_n;      /* Expression: P
                                        * Referenced by: '<S19>/Proportional Gain'
                                        */
  real_T Integrator_gainval;           /* Computed Parameter: Integrator_gainval
                                        * Referenced by: '<S19>/Integrator'
                                        */
  real_T Integrator_IC;                /* Expression: InitialConditionForIntegrator
                                        * Referenced by: '<S19>/Integrator'
                                        */
  real_T DerivativeGain_Gain_a;        /* Expression: D
                                        * Referenced by: '<S19>/Derivative Gain'
                                        */
  real_T Filter_gainval_f;             /* Computed Parameter: Filter_gainval_f
                                        * Referenced by: '<S19>/Filter'
                                        */
  real_T Filter_IC_g;                  /* Expression: InitialConditionForFilter
                                        * Referenced by: '<S19>/Filter'
                                        */
  real_T FilterCoefficient_Gain_o;     /* Expression: N
                                        * Referenced by: '<S19>/Filter Coefficient'
                                        */
  real_T Saturation_UpperSat_p;        /* Expression: UpperSaturationLimit
                                        * Referenced by: '<S19>/Saturation'
                                        */
  real_T Saturation_LowerSat_h;        /* Expression: LowerSaturationLimit
                                        * Referenced by: '<S19>/Saturation'
                                        */
  real_T Saturation_UpperSat_h;        /* Expression: 1
                                        * Referenced by: '<S6>/Saturation'
                                        */
  real_T Saturation_LowerSat_g;        /* Expression: 0
                                        * Referenced by: '<S6>/Saturation'
                                        */
  real_T Converter_Gain;               /* Expression: 250
                                        * Referenced by: '<S6>/Converter'
                                        */
  real_T Bias_Bias_j;                  /* Expression: 1100
                                        * Referenced by: '<S6>/Bias'
                                        */
  real_T Saturation_UpperSat_pz;       /* Expression: 1
                                        * Referenced by: '<S7>/Saturation'
                                        */
  real_T Saturation_LowerSat_l;        /* Expression: 0
                                        * Referenced by: '<S7>/Saturation'
                                        */
  real_T Converter_Gain_f;             /* Expression: 250
                                        * Referenced by: '<S7>/Converter'
                                        */
  real_T Bias_Bias_i;                  /* Expression: 1100
                                        * Referenced by: '<S7>/Bias'
                                        */
  real_T JoyScale_Gain_d;              /* Expression: 0.25
                                        * Referenced by: '<S9>/JoyScale'
                                        */
  real_T ProportionalGain_Gain_b;      /* Expression: P
                                        * Referenced by: '<S13>/Proportional Gain'
                                        */
  real_T Integrator_gainval_p;         /* Computed Parameter: Integrator_gainval_p
                                        * Referenced by: '<S13>/Integrator'
                                        */
  real_T Integrator_IC_d;              /* Expression: InitialConditionForIntegrator
                                        * Referenced by: '<S13>/Integrator'
                                        */
  real_T DerivativeGain_Gain_g;        /* Expression: D
                                        * Referenced by: '<S13>/Derivative Gain'
                                        */
  real_T Filter_gainval_fg;            /* Computed Parameter: Filter_gainval_fg
                                        * Referenced by: '<S13>/Filter'
                                        */
  real_T Filter_IC_d;                  /* Expression: InitialConditionForFilter
                                        * Referenced by: '<S13>/Filter'
                                        */
  real_T FilterCoefficient_Gain_k;     /* Expression: N
                                        * Referenced by: '<S13>/Filter Coefficient'
                                        */
  real_T ProportionalGain_Gain_j;      /* Expression: P
                                        * Referenced by: '<S12>/Proportional Gain'
                                        */
  real_T Integrator_gainval_i;         /* Computed Parameter: Integrator_gainval_i
                                        * Referenced by: '<S12>/Integrator'
                                        */
  real_T Integrator_IC_g;              /* Expression: InitialConditionForIntegrator
                                        * Referenced by: '<S12>/Integrator'
                                        */
  real_T DerivativeGain_Gain_h;        /* Expression: D
                                        * Referenced by: '<S12>/Derivative Gain'
                                        */
  real_T Filter_gainval_k;             /* Computed Parameter: Filter_gainval_k
                                        * Referenced by: '<S12>/Filter'
                                        */
  real_T Filter_IC_c;                  /* Expression: InitialConditionForFilter
                                        * Referenced by: '<S12>/Filter'
                                        */
  real_T FilterCoefficient_Gain_f;     /* Expression: N
                                        * Referenced by: '<S12>/Filter Coefficient'
                                        */
  real_T Saturation_UpperSat_m;        /* Expression: UpperSaturationLimit
                                        * Referenced by: '<S12>/Saturation'
                                        */
  real_T Saturation_LowerSat_k;        /* Expression: LowerSaturationLimit
                                        * Referenced by: '<S12>/Saturation'
                                        */
  real_T Saturation_UpperSat_mo;       /* Expression: 1
                                        * Referenced by: '<S8>/Saturation'
                                        */
  real_T Saturation_LowerSat_c;        /* Expression: 0
                                        * Referenced by: '<S8>/Saturation'
                                        */
  real_T Converter_Gain_g;             /* Expression: 500
                                        * Referenced by: '<S8>/Converter'
                                        */
  real_T Bias_Bias_h;                  /* Expression: 1100
                                        * Referenced by: '<S8>/Bias'
                                        */
  real_T IntegralGain_Gain;            /* Expression: I
                                        * Referenced by: '<S12>/Integral Gain'
                                        */
  real_T IntegralGain_Gain_n;          /* Expression: I
                                        * Referenced by: '<S13>/Integral Gain'
                                        */
  real_T JoyScale_Gain_b;              /* Expression: 0.25
                                        * Referenced by: '<S10>/JoyScale'
                                        */
  real_T DerivativeGain_Gain_o;        /* Expression: D
                                        * Referenced by: '<S14>/Derivative Gain'
                                        */
  real_T Filter_gainval_c;             /* Computed Parameter: Filter_gainval_c
                                        * Referenced by: '<S14>/Filter'
                                        */
  real_T Filter_IC_o;                  /* Expression: InitialConditionForFilter
                                        * Referenced by: '<S14>/Filter'
                                        */
  real_T FilterCoefficient_Gain_m;     /* Expression: N
                                        * Referenced by: '<S14>/Filter Coefficient'
                                        */
  real_T IntegralGain_Gain_p;          /* Expression: I
                                        * Referenced by: '<S14>/Integral Gain'
                                        */
  real_T Integrator_gainval_j;         /* Computed Parameter: Integrator_gainval_j
                                        * Referenced by: '<S14>/Integrator'
                                        */
  real_T Integrator_IC_c;              /* Expression: InitialConditionForIntegrator
                                        * Referenced by: '<S14>/Integrator'
                                        */
  real_T ProportionalGain_Gain_nw;     /* Expression: P
                                        * Referenced by: '<S14>/Proportional Gain'
                                        */
  real_T Saturation_UpperSat_f;        /* Expression: UpperSaturationLimit
                                        * Referenced by: '<S14>/Saturation'
                                        */
  real_T Saturation_LowerSat_o;        /* Expression: LowerSaturationLimit
                                        * Referenced by: '<S14>/Saturation'
                                        */
  real_T IntegralGain_Gain_h;          /* Expression: I
                                        * Referenced by: '<S19>/Integral Gain'
                                        */
  real_T Bias_Bias_jz;                 /* Expression: 1
                                        * Referenced by: '<S4>/Bias'
                                        */
  real_T Gain_Gain_m;                  /* Expression: 1000
                                        * Referenced by: '<S4>/Gain'
                                        */
  real_T Switch_Threshold;             /* Expression: 0.5
                                        * Referenced by: '<S5>/Switch'
                                        */
  real_T Switch1_Threshold;            /* Expression: 0.5
                                        * Referenced by: '<S5>/Switch1'
                                        */
};

/* Real-time Model Data Structure */
struct RT_MODEL_Auto {
  const char_T * volatile errorStatus;
};

/* Block parameters (auto storage) */
extern Parameters_Auto Auto_P;

/* Block signals (auto storage) */
extern BlockIO_Auto Auto_B;

/* Block states (auto storage) */
extern D_Work_Auto Auto_DWork;

/* External inputs (root inport signals with auto storage) */
extern ExternalInputs_Auto Auto_U;

/* External outputs (root outports fed by signals with auto storage) */
extern ExternalOutputs_Auto Auto_Y;

#ifdef __cplusplus

extern "C" {

#endif

  /* Model entry point functions */
  extern void Auto_initialize(void);
  extern void Auto_step(void);
  extern void Auto_terminate(void);

#ifdef __cplusplus

}
#endif

/* Real-time Model object */
#ifdef __cplusplus

extern "C" {

#endif

  extern struct RT_MODEL_Auto *const Auto_M;

#ifdef __cplusplus

}
#endif

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Note that this particular code originates from a subsystem build,
 * and has its own system numbers different from the parent model.
 * Refer to the system hierarchy for this subsystem below, and use the
 * MATLAB hilite_system command to trace the generated code back
 * to the parent model.  For example,
 *
 * hilite_system('main/Auto Ctrl')    - opens subsystem main/Auto Ctrl
 * hilite_system('main/Auto Ctrl/Kp') - opens and selects block Kp
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : main
 * '<S1>'   : main/Auto Ctrl
 * '<S2>'   : main/Auto Ctrl/AutoController
 * '<S3>'   : main/Auto Ctrl/Chart
 * '<S4>'   : main/Auto Ctrl/Rescale Throttle
 * '<S5>'   : main/Auto Ctrl/ThrOverride
 * '<S6>'   : main/Auto Ctrl/AutoController/Norm2PWM
 * '<S7>'   : main/Auto Ctrl/AutoController/Norm2PWM1
 * '<S8>'   : main/Auto Ctrl/AutoController/Norm2PWM2
 * '<S9>'   : main/Auto Ctrl/AutoController/PitchCtrl
 * '<S10>'  : main/Auto Ctrl/AutoController/TailCtrl
 * '<S11>'  : main/Auto Ctrl/AutoController/Variant Subsystem
 * '<S12>'  : main/Auto Ctrl/AutoController/PitchCtrl/Discrete PID Controller
 * '<S13>'  : main/Auto Ctrl/AutoController/PitchCtrl/Discrete PID Controller1
 * '<S14>'  : main/Auto Ctrl/AutoController/TailCtrl/Discrete PID Controller
 * '<S15>'  : main/Auto Ctrl/AutoController/Variant Subsystem/1PID
 * '<S16>'  : main/Auto Ctrl/AutoController/Variant Subsystem/KASKADA
 * '<S17>'  : main/Auto Ctrl/AutoController/Variant Subsystem/ORIGIGI
 * '<S18>'  : main/Auto Ctrl/AutoController/Variant Subsystem/KASKADA/Discrete PID Controller1
 * '<S19>'  : main/Auto Ctrl/AutoController/Variant Subsystem/KASKADA/Discrete PID Controller2
 */
#endif                                 /* RTW_HEADER_Auto_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
